﻿using System;
using System.Web;

namespace FBGraph.Web
{
    /// <summary>An implementation of <see cref="IHttpResponseWrapper" /> that wraps <see cref="HttpResponse" />.</summary>
    public class ClassicHttpResponseWrapper : IHttpResponseWrapper
    {
        private HttpResponse response;

        internal ClassicHttpResponseWrapper(HttpResponse response)
        {
            this.response = response;
        }

        /// <summary>Gets the response cookie collection.</summary>
        public HttpCookieCollection Cookies { get { return this.response.Cookies; } }

        /// <summary>Updates an existing cookie in the cookie collection.</summary>
        /// <param name="cookie">The cookie in the collection to be updated.</param>
        public void SetCookie(HttpCookie cookie) { this.response.SetCookie(cookie); }
    }
}